<?php
class Custom_View_Helper_Imagetag extends Zend_View_Helper_HtmlElement
{
    public function imageTag($src, $attribs = null)
    {
        $module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();

        $url = $this->view->baseUrl() .
               $this->view->pathSkin .
               $module.'/'.
               $this->view->{$module}['template'].
               '/img/' .$this->view->Escape($src);

        if (null === $attribs) {
            $options = '';
        } else {
            $arr = Custom_Utility_Parse::stringToArray($attribs);
            if (isset($arr['size'])) {
                list($arr['width'], $arr['height']) = explode('x', $arr['size'], 2);
                unset($arr['size']);
            }
            $options = $this->_htmlAttribs($arr);
        }
        
        return '<img src="' . $url .'"'. $options . ' />';
    }
}